<extend name="Base/common"/>
<block name="Content">
<div class="am-cf am-padding-top">
    <div class="am-fl am-cf">
        <i class="am-icon-file"></i>
        <strong class="am-text-primary am-text-lg">数据字典</strong>
    </div>
    <hr data-am-widget="divider" style="" class="am-divider am-divider-default" />
</div>
<div class="am-u-sm-12 am-u-md-6" style="padding:0px">
    <div class="am-btn-toolbar">
        <div class="am-btn-group am-btn-group-xs">
            <a type="button" class="am-btn am-btn-success" href="{:U('Dictionary/editAction')}"><span class="am-icon-plus"></span>&nbsp;新增</a>
            <button type="button" class="am-btn am-btn-warning ajax-post confirm" url="{:U('del')}" target-form="ck">
                <span class="am-icon-trash-o"></span>
                删除
            </button>
        </div>
    </div>
</div>

</fieldset>
<table class="am-table am-table-striped am-table-hover table-main" id="table">
    <thead>
        <tr>
            <th class="table-check">
                <input type="checkbox" class="checkAll" />
            </th>
            <th class="table-id" style="width:5%">
                ID
            </th>
            <th class="table-title" style="width:20%">
                标识
            </th>
            <th class="table-type" style="width:15%">
                名称
            </th>
            <th class="table-type" style="width:10%">
                类型
            </th>
            <th class="table-set" style="width:25%">
                备注
            </th>
            <th class="table-set" style="width:20%">
                操作
            </th>
        </tr>
    </thead>
    <tbody>
        <notempty name="list">
            <foreach name="list" item="dictionary">
                <tr>
                    <td>
                        <input type="checkbox" value="{$dictionary.dict_id}" name="dict_id[]" class="ck"/>
                    </td>
                    <td>
                        {$dictionary.dict_id}
                    </td>
                    <td>
                        {$dictionary.dict_group}
                    </td>
                    <td>
                        {$dictionary.dict_name}
                    </td>
                    <td>
                        {$dictionary.dict_type}
                    </td>
                    <td>
                        {$dictionary.remark}
                    </td>
                    <td>
                        <div class="am-btn-toolbar">
                            <div class="am-btn-group am-btn-group-xs">
                                <a class="am-btn am-btn-default am-btn-xs am-text-success " href="{:U('Dictionary/dictEnumList?dictionary_id='.$dictionary['dict_id'])}"><span class="am-icon-pencil-square-o"></span>查看子类</a>
                                <a class="am-btn am-btn-default am-btn-xs am-text-secondary" href="{:U('Dictionary/editAction?dict_id='.$dictionary['dict_id'])}"><span class="am-icon-pencil-square-o"></span>编辑</a>
                            </div>
                        </div>
                    </td>
                </tr>
            </foreach>
            <else/>
            <td colspan="7" class="text-center">
                暂时还没有内容! 
            </td>
        </notempty>
    </tbody>
</table>
<!-- 分页 -->
<ul class="am-pagination am-pagination-default am-no-layout amz-social">
    {$_page}
</ul>
</block>
<block name="script">
    <script type="text/javascript">
        
        $(function(){
        
            $("#update").click(function(){
            
                var search = $('.ck:checked');
                
                if (search.length == 0) {
                    alert("请选择一项!");
                    
                }
                else 
                    if (search.length != 1) {
                        alert("只能选择一项!");
                    }
                    else {
                        var str = search.val();//获取里面的值
                        window.location.href = url;
                    }
            });
            
            $("select[name=dict]").on('change', function(){
                if ($(this).val() != "0") {
                    var status = $(this).val();
					
                    window.location.href =Think.U('Dictionary/dictEnumList','dictionary_id='+status);
                }
                
            });
        })
    </script>
</block>
